<!doctype html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<div th:replace="module/macros :: head"></div>

<body class="user-select">

<link rel="stylesheet" type="text/css" th:href="@{/plugins/toast/jquery.toast.css}">

<div th:replace="module/macros :: header(6)"></div>

<section class="container container-page">

  <div th:replace="admin/admin_module/admin_macros :: push(2)"></div>

  <div class="tile">
    <input type="hidden" id="articleId">
    <a thref="#"><span style="color:#5bc0de">用户</span></a>
    <div class="table-responsive">
      <table class="table table-striped table-bordered table-hover" id="article_table">
        <tr>
          <td>
              <div class="tile">
                    <header class="article-header">
                      <h1 class="article-title">所有用户</h1>
                    </header>
                    <div class="table-responsive">
                      <table class="table table-striped table-bordered table-hover">
                        <tr>
                          <td>用户名</td>
                          <td>电话</td>
                          <td>创建时间</td>
                          <td>qq</td>
                          <td>微信</td>
                          <td>操作</td>
                        </tr>
                        <tr th:each="user : ${info.list}">

                          <td th:text="${user.userNickname}" class="mt-auto"></td>
                          <td th:text="${user.userPhone}" class="mt-auto"></td>
                          <td th:text="${#dates.format(user.userCreatetime,'yyyy/MM/dd HH:mm:ss')}"></td>
                          <td th:text="${user.userQq}" class="mt-auto"></td>
                          <td th:text="${user.userWechat}" class="mt-auto"></td>
                          <td>
                            <a th:href="@{/admin/user/update(userId=${user.userId})}" class="btn-success button btn-sm ">编辑</a>
                            <button th:onclick="'javascript:remove('+${user.userId}+')'" class="btn-danger button btn-sm">删除(不可逆)</button>
                          </td>
                        </tr>
                        <tr th:unless="${info.list.total} != 0">
                          <td th:attr="colspan='4',align='center'">暂无启示</td>
                        </tr>
                      </table>
                      <div th:replace="module/macros :: pagePost(${info})"></div>
                    </div>
                  </div>
          </td>
        </tr>
      </table>
    </div>
  </div>

</section>

<div th:replace="module/macros :: footer"></div>


<div th:replace="module/macros :: footer_js"></div>
<div th:replace="module/macros :: photo_js"></div>
<script type="text/javascript" th:src="@{/js/mayday.js}"></script>
<script type="text/javascript" th:src="@{/plugins/toast/jquery.toast.js}"></script>

<script>


  function remove(userId) {
      var r=confirm("确定删除吗!");
      if (r==true){
        window.location.href = "/admin/user/delete?userId="+userId;
      }
      else{
      }
  }

</script>
</body>
</html>